var method ={
	setScroll:function(isreturn,classname){//局部滚动添加样式local_scroll,回调
		if(classname==undefined){
			classname="main";
		}
		classname="."+classname;
		var elm=document.querySelector(classname);
		var isover=true;//用于判断回调是否执行一次
		var overscroll = function(el,isreturn) {
			if(el==null){
				return;
			}
			el.addEventListener('touchstart', function() {
			    var top = el.scrollTop,totalScroll = el.scrollHeight,currentScroll = top+el.offsetHeight;
			    if(top === 0) {
			      el.scrollTop = 1;
			    }else if(currentScroll === totalScroll) {
			      el.scrollTop = top - 1;
			    } 
				if(isover && isreturn!=null){
					isreturn();isover=false;
				}	
			});
			el.addEventListener('touchmove', function(evt) {
			    if(el.offsetHeight < el.scrollHeight){evt._isScroller = true;}  	
			});
		}
		if(elm!=null){//取消body的滚动
			document.body.addEventListener('touchmove', this.handler, false);
		}
		overscroll(elm,isreturn);
	},
	handler:function(){
		if(!event._isScroller){
			event.preventDefault();
		}
	},
};
